/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jwu2.indexserver;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Rolf
 */
public class Packet implements Serializable {
    
    public enum NetProtocol {
        WHATSNEW, //Ask the server whats new since some timestamp (Or reply from server)
        VERSION, //Ask the server its version (Or reply from server)
        BYE, //End communication
    }
    
    private NetProtocol command;
    private List<Object> data;
    
    public Packet(NetProtocol command) {
        this.command = command;
        data = new ArrayList<Object>();
    }
    
    public void addData(Object o) {
        data.add(o);
    }
    
    public List<Object> getData() {
        return data;
    }
    
    public NetProtocol getCommand() {
        return command;
    }
    
    public void setData(List<Object> data) {
        this.data = data;
    }
}
